home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
odosrc
/
diskinf.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
3KB
|
108 lines
VERSION 2.00
Begin Form Form1
Caption = "Form1"
ClientHeight = 1980
ClientLeft = 1320
ClientTop = 2265
ClientWidth = 2775
Height = 2385
Left = 1260
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 1980
ScaleWidth = 2775
Top = 1920
Width = 2895
Begin CommandButton Command3
Caption = "Free Res"
Height = 495
Left = 120
TabIndex = 6
Top = 1320
Width = 1095
End
Begin TextBox Text1
Height = 285
Left = 2040
TabIndex = 1
Text = "1"
Top = 840
Width = 375
End
Begin CommandButton Command2
Caption = "FreeMem"
Height = 495
Left = 120
TabIndex = 5
Top = 720
Width = 1095
End
Begin TextBox Text2
Height = 285
Left = 2040
TabIndex = 2
Text = "3"
Top = 240
Width = 375
End
Begin CommandButton Command1
Caption = "DiskInfo"
Default = -1 'True
Height = 495
Left = 120
TabIndex = 0
Top = 120
Width = 1095
End
Begin Label Label2
Caption = "Info:"
Height = 255
Left = 1440
TabIndex = 4
Top = 840
Width = 495
End
Begin Label Label1
Caption = "Disk:"
Height = 255
Left = 1440
TabIndex = 3
Top = 240
Width = 495
End
End
Declare Function DiskInfo& Lib "DISKINFO.DLL" (ByVal DriveNum As Integer, ByVal InfoType As Integer)
Declare Function GetFreeMem& Lib "DISKINFO.DLL" ()
Declare Function GetFreeRes% Lib "DISKINFO.DLL" (ByVal InfoType As Integer)
Sub Command1_Click ()
z% = Val(Text1.text)
y% = Val(text2.text)
x& = DiskInfo&(y%, z%)
MsgBox Format$(x&, "###,###,###")
End Sub
Sub Command2_Click ()
x& = GetFreeMem&() \ 1024
MsgBox "Free Memory = " + Format$(x&, "#,###") + "K"
End Sub
Sub Command3_Click ()
z% = Val(Text1.text)
x% = GetFreeRes%(z%)
res$ = ""
Select Case z%
Case 0
res$ = " [System]"
Case 1
res$ = " [GDI]"
Case 2
res$ = " [User]"
End Select
MsgBox Format$(x%, "##") + "% Free Resources" + res$
End Sub